import { createApp } from 'vue';
import ArcoVue from '@arco-design/web-vue';
import ArcoVueIcon from '@arco-design/web-vue/es/icon';
import globalComponents from '@/components';
import router from './router';
import store from './store';
import i18n from './locale';
import _ from "lodash"
import directive from './directive';
import App from './App.vue';
import '@/api/interceptor';
import element from './plugin/element';
import '@/assets/style/defineElementUI.less'
import * as ElementPlusIconsVue from '@element-plus/icons-vue';
import './assets/font/iconfont.css';
import '@/assets/style/global.less';
import '@/utils/initCornerstone.js';
// import { RouteRecordRaw } from 'vue-router';
// import './mock';//提测时记得注掉

if (window.location.hash.includes('mpr')) {
  import('./utils/initCornerstone.js').then(() => {
    setupApp()
  })
} else {
  setupApp()
}

function setupApp() {
  const app = createApp(App);
  element(app);
  for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
      app.component(key, component)
  }
  app.use(ArcoVue, {});
  app.use(ArcoVueIcon);

  app.use(router);
  app.use(store);
  app.use(i18n);
  app.use(globalComponents);
  app.use(directive);
  app.mount('#app');
  
}
